package xyz.kongbai121.demo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;
import java.util.List;

/**
 * 评论实体类
 * @author 空白
 */
@Getter
@Setter
@ToString
public class Comment {
    @TableId(type = IdType.AUTO)
    private Long id;                    //评论id
    private String content;             //评论内容
    private String openid;              //用户唯一标识
    private Long articleId;             //文章id
    private Long commentId;             //父评论id
    private String toOpenid;            //评论内容
    private String articleHead;         //文章标题
    private Date deliverTime;           //发送时间
    private String authorOpenid;        //发布者id
    private Integer isRead;             //是否已读

    @TableField(exist = false)
    private User user;                  //用户信息
    @TableField(exist = false)
    private User toUser;                //被评论用户信息
    @TableField(exist = false)
    private List<Comment> comments;     //子评论列表
}
